ALTER TEXT SEARCH DICTIONARY
ALTER TEXT SEARCH DICTIONARY — Change the Definition of a Text Search Dictionary
Synopsis
ALTER TEXT SEARCH DICTIONARY name (option [ = value ] [, ... ])
ALTER TEXT SEARCH DICTIONARY name RENAME TO new_name
ALTER TEXT SEARCH DICTIONARY name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
ALTER TEXT SEARCH DICTIONARY name SET SCHEMA new_schema
Description
ALTER TEXT SEARCH DICTIONARY changes the definition of a text search dictionary. You can change the dictionary's template-specific options, or change the dictionary's name or owner.
You must be a superuser to use ALTER TEXT SEARCH DICTIONARY.
Parameters
name
The name (optionally schema-qualified) of an existing text search dictionary.
option
The name of a template-specific option to set for this dictionary.
value
The new value for a template-specific option. If the equals sign and value are omitted, the previous setting for the option is removed from the dictionary, allowing the default value to be used.
new_name
The new name of the text search dictionary.
new_owner
The new owner of the text search dictionary.
new_schema
The new schema for the text search dictionary.
Template-specific options can appear in any order.
Examples
# The following command changes the stopword list of a Snowball-based dictionary. Other parameters remain unchanged:
ALTER TEXT SEARCH DICTIONARY my_dict ( StopWords = newrussian );
# The following command changes the language option to dutch and completely removes the stopword option:
ALTER TEXT SEARCH DICTIONARY my_dict ( language = dutch, StopWords );
# The following command "updates" the dictionary's definition without actually changing anything:
ALTER TEXT SEARCH DICTIONARY my_dict ( dummy );
# (This works because the option removal code does not complain when the option does not exist). This trick is useful when changing configuration files for the dictionary: ALTER will force existing database sessions to re-read the configuration files, which they would otherwise not do if they had previously read them.